package com.dousb.cloudlibrary.config;


import io.minio.MinioClient;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MinIOConfig
 * MInIO配置类
 *
 * @author 豆沙包
 * @version 1.0
 * @since 2025-09-23  00:51
 */
@Configuration
@ConfigurationProperties(prefix = "minio")
@Setter
public class MinIOConfig {

    private String endpoint;
    private String accessKey;
    private String secretKey;


    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(endpoint)
                .credentials(accessKey, secretKey)
                .build();
    }
}
